package moxl.relaxng.schema.patterns;

import moxl.relaxng.schema.Pattern;

public class ChoicePattern implements Pattern
{
	private final Pattern firstPattern;
	private final Pattern secondPattern;

	public ChoicePattern(Pattern firstPattern, Pattern secondPattern)
	{
		this.firstPattern = firstPattern;
		this.secondPattern = secondPattern;
	}

	public boolean nullable()
	{
		return firstPattern.nullable() || secondPattern.nullable();
	}

	public Pattern getFirstPattern()
	{
		return firstPattern;
	}

	public Pattern getSecondPattern()
	{
		return secondPattern;
	}

}
